<%@ page contentType="text/html; charset=utf-8" language="java" import="java.util.*" import="java.sql.*" errorPage="" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
   <title>人员信息表</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
	    
	<h2>人员编号查询</h2>
	<p>
	本页为新光零部件在职人员编号。<br />
	人员编号唯一标识公司人员信息，一经创建不再改变，无论人员是否离职。<br />
	
	新员工入职时，创建自动创建人员编号。<br />
	已离职员工重新入职时，仍使用原编号。
	</p>
	<table border="3" cellpadding="3" cellspacing="0">
	<tr>
	<th>人员编号</th><th>姓名</th><th>身份证号</th><th>人员状态</th>
	</tr>
	<%
	Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
	Connection conn= DriverManager.getConnection("jdbc:sqlserver://192.168.2.19;DatabaseName=htqc_Human_resource;user=sa;password=110119");
	Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
	
	String sql = "select [人员编号],[姓名],[身份证号],[人员状态] from [人员列表] order by [人员编号]";
	ResultSet rs=stmt.executeQuery(sql);
	
	while(rs.next()){
		out.print("<tr>");
		out.print("<td>"+rs.getInt("人员编号")+"</td>");
		out.print("<td>"+rs.getString("姓名")+"</td>");
		out.print("<td>"+rs.getString("身份证号")+"</td>");
		out.print("<td>"+rs.getString("人员状态")+"</td>");
		out.print("</tr>");
	}
	rs.close();
	stmt.close();
	conn.close();
	%>
	</table>
	<br /><br />
	<table width="200%" border="0">
	    <tr>如有问题或需修改，</tr>
	    <tr>请联系杨承睿</tr>
	    <tr>tel:8505</tr>
	    <tr>mob:156 4042 1321</tr>
	    <tr>email:yangchengrui@htqc.com</tr>
	    <tr>&nbsp;&nbsp;2587603267@qq.com</tr>
	    <tr>qq：2587603267</tr>
	</table>

  </body>
</html>
